package com.mtu.parser;

import java.io.IOException;

import javax.lang.model.util.Elements;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class HTMLParser 
{

	private Document d;
	private String url;
	private String content;
	Elements ele;

	public static void main(String[] args) {
		new HTMLParser(
				"http://www.uptu.ac.in/results/EVEN_SEMESTER_10_11/bte6_10_11.asp?rollno=0806410005");
	}

	public HTMLParser(String url) {
		this.url = url;
		connect();
		parse();
		display();

	}

	private void connect() {
		try {
			d = Jsoup.connect(url).get();
		} catch (IOException e) {
			System.out.println("Connection not established");
		}
	}

	private void parse() {

		System.out.println();
		content = d.tagName("table").text();
	}

	private void display() {
		System.out.println(content);
	}

}